<div class="layui-fluid nepadmin-pad0 nepadmin-mar0 list0" id="list" lay-title="交易流水">
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card hxr-layui-card" id="userlistv">
                    <div class="layui-form layui-card-header hxradmin-card-header">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">关键词查询</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="search_text" placeholder="会员姓名、设备id、游戏名" class="layui-input" autocomplete="off">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label" style='width:85px;'>游戏日期范围</label>
                                <div class="layui-input-inline" style="width: 350px;    ">
                                    <input type="text" name="val2" id='date' placeholder = "选择游戏时间" autocomplete="off" class="layui-input" readonly>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <button class="layui-btn" data-type="reload" id="search">搜索</button>
                            </div>
                        </div>
                    </div>
                    <div class="layui-card-body">
                        <table class="layui-hide" id="list-table" lay-filter="list-table"></table>
                        <script type="text/html" id="status">
                            {{#  if(d.is_ranked === 1){ }}
                            <span class="layui-badge">排位赛</span>
                            {{#  } else if(d.is_ranked === 2) { }}
                            <span class="layui-badge layui-bg-green">匹配赛</span>
                            {{#  } }}
                        </script>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    //表格数据渲染
    layui.use(['table', 'form','laydate'], function() {
        var table = layui.table,
            form = layui.form,
            $ = layui.$,laydate=layui.laydate;
        //日期范围
        laydate.render({
            elem: '#date'
            ,range: '~'
        });

        layui.admin.initlist(table,'member_game/get_list',240,[
            [{
                field: 'id',
                title: 'ID',
                width: 60
            },{
                field: 'device_id',
                title: '设备id',
                minWidth: 100
            },{
                field: 'real_name',
                title: '会员姓名',
                minWidth: 100
            },{field: 'summoner_name',
                title: '玩家名称',
                minWidth: 200
            },
                {
                field: 'ranking',
                title: '排名',
                minWidth: 40
            }, {
                field: 'blood_volume',
                title: '血量',
                minWidth: 60
            }, {
                field: 'star_details',
                title: '英雄详情',
                width: 250
            }, {
                field: 'money',
                title: '赠送网费',
                width: 150
            }, {
                field: 'money_detail',
                title: '网费详情',
                width: 150
            }, {
                field: 'grading',
                title: '段位',
                width: 150
            }, {
                field: 'is_ranked',
                title: '是否排位赛',
                width: 100,
                templet:'#status'
            },{
                field: 'agent_name',
                title: '代理姓名',
                width: 100
            }, {
                field: 'play_time',
                title: '游戏时间',
                width: 200
            }]
        ])

        //搜索
        $('#search').on('click', function() {
            var obj=$(this).parents('.layui-form-item');
            var val1 = obj.find('input[name="search_text"]').val(),
                val2 = $('input[name="val2"]').val();

            layui.admin.reloads({
                search_text:val1,
                time_text:val2
            });
        });

    });
</script>
